<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div ng-app="myNoteApp" ng-controller="myNoteCtrl">
    <h2>我的笔记</h2>
    <p><textarea ng-model="message" cols="40" rows="10"></textarea></p>
    <p>
      <button ng-click="save()">保存</button>
      <button ng-click="clear()">清除</button>
    </p>
    <p>Number of characters left: <span ng-bind="left()"></span></p>
  </div>

  <script src="./static/angular.min.js"></script>

  <script>
    var app = angular.module("myNoteApp", []);
    app.controller("myNoteCtrl", function ($scope) {
      $scope.message = "";
      $scope.left = function () { return 100 - $scope.message.length; };
      $scope.clear = function () { $scope.message = ""; };
      $scope.save = function () { alert("Note Saved"); };
    });
  </script>
</body>

</html>